import { InjectionKey } from 'vue'
export interface paneProps {
  uid?: string
  size?: string | null
  minSize?: string | null
  maxSize?: string | null
  style?: CSSStyleValue | undefined
}
export interface paneState {
  style: CSSStyleValue | undefined
}

export interface paneSize {
  value: number
  unit: string
}

export interface splitpaneProps {
  horizontal?: boolean
  pushOtherPanes?: boolean
  dblClickSplitter?: boolean
  splitterColor?: string
  activeColor?: string
  splitterSize?: string
}
export interface KeyValue<T = any> {
  [key: string]: T
}
export interface pane {
  [key: string]: any
}

export interface splitpaneState {
  uid: string | undefined
  horizontal: boolean
  container: HTMLElement | null
  ready: boolean
  panes: Array<pane>
  touch: KeyValue
  splitterTaps: KeyValue
  splitterColor: string
  activeColor: string
  splitterSize: string
}

export interface changedPanes {
  addedPane: pane
  removedPane: pane
}

export interface sums {
  prevPanesSize: number
  nextPanesSize: number
  prevReachedMinPanes: number
  nextReachedMinPanes: number
}
export type RequestUpdateArgs = { uid: string; [k: string]: any }
export type requestUpdate = ({ uid, ...args }: RequestUpdateArgs) => void
export type onPaneAdd = (pane: pane) => void
export type onPaneRemove = (pane: pane) => void
export type onPaneClick = (event: Event, uid: string) => void
export const requestUpdate_key: InjectionKey<requestUpdate> = Symbol('')
export const onPaneRemove_key: InjectionKey<onPaneRemove> = Symbol('')
export const onPaneAdd_key: InjectionKey<onPaneAdd> = Symbol('')
export const onPaneClick_key: InjectionKey<onPaneClick> = Symbol('')
